#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>

int sumar(int a, int b);
int restar(int a, int b);
int mult(int a, int b);
int dividir(int a, int b);


int main(int argc, char *argv[])
{
    if(argc < 2)
    {
        fprintf(stderr, "Wrong number of args");
        exit(1);
    }
    int a = 1, b =2;
    int (*operar) (int, int);
    switch(argv[1][0])
    {
        case '+':
            operar = sumar;
            printf("%d\n", operar(a, b));
            break;
        case '-':
            operar = restar;
            printf("%d\n", operar(a, b));
            break;
        case '*':
            operar = mult;
            printf("%d\n", operar(a, b));
            break;
        case '/':
            operar = dividir;
            printf("%d\n", operar(a, b));
            break;
    }
    return 0;
}

int sumar(int a, int b)
{
    return a + b;
}

int restar(int a, int b)
{
    return a - b;
}

int mult(int a, int b)
{
    return a * b;
}

int dividir(int a, int b)
{
    return a / b;
}

